﻿namespace Journey.DTO.Profiles
{
    using AutoMapper;
    
    using Journey.Security;
    using Journey.DTO.Users;

    /// <summary>
    /// 用户对象映射配置。
    /// </summary>
    public class UserProfile : Profile
    {
        /// <summary>
        /// 配置映射。
        /// </summary>
        protected override void Configure()
        {
            //User => UserDTO
            var map = Mapper.CreateMap<User, UserDTO>();
            map.ForMember(dto => dto.AccountNumber, mc => mc.MapFrom(e => e.Account.AccountNumber));
        }
    }
}